
{{if empty($_GET['inajax'])}}

<style>
{{if $model== 'EditorStyle'}}
.editor-style-content{overflow:hidden;color:#3e3e3e}
.editor-style-content *{max-width:100%!important;box-sizing:border-box!important;-webkit-box-sizing:border-box!important;word-wrap:break-word!important}
.editor-style-content p{clear:both;min-height:1em;white-space:pre-wrap}
.editor-style-content em{font-style:italic}
.editor-style-content fieldset{min-width:0}
.editor-style-content .list-paddingleft-2{padding-left:30px}
.editor-style-content blockquote{margin:0;padding-left:10px;border-left:3px solid #dbdbdb}
img{height:auto!important;max-width:100%;}
/* fix Firefox - max-width images not working within fieldset */
fieldset img{width: 100%;max-width: -moz-fit-content;max-width: -webkit-fit-content;}
{{elseif $model== 'Color'}}
.style-list{margin: 15px 3px 20px;box-shadow: 0 0 3px rgba(172,165,150,0.5);background:#ede8de;padding:0px;position:relative;border-radius:2px;}
.style-list:hover{z-index:20;box-shadow: 0 0 5px rgba(172,165,150,0.5);}
.style-list:hover .tools{display:block;}
.style-list .content{background:#fefefe;padding:13px;}
.style-list .tools{text-align:left;width:100%;padding:15px;color:#FFF;}
.style-list .tools a,.style-list .tools a:hover{text-decoration: none;color:#3a3332;font-size:16px;}
.style-list .tools .title{height:24px;line-height:24px;}

.template-cover{width:340px;height:480px;max-width: 100%;}
.color-swatch{width:30px;height:30px;border-radius:3px;font-size:12px;cursor: pointer;display: inline-block;margin:4px 4px 0px 0;}
.color-swatch:hover,.color-swatch.active {	
	-webkit-transform:scale(1.1);-moz-transform:scale(1.1);-ms-transform:scale(1.1);
	-o-transform:scale(1.1);transform:scale(1.1);
	-webkit-box-shadow:inset 1px 1px 1px #5b616d,0 0 5px #45bcda;
	-moz-box-shadow:inset 1px 1px 1px #5b616d,0 0 5px #45bcda;
	box-shadow:inset 1px 1px 1px #5b616d,0 0 5px #45bcda;
}
.tooltip-inner{text-align:left;padding:10px 15px;}
{{/if}}
</style>


		<h3 class="name">{{__('Favorite list')}}</h3>
		<div id="favorite-color-tabs">
		{{if $model=='Color'}}
		<ul class="nav nav-tabs">
			
			
				{{if count($CurrentUser['role_id']) > 1}}
			  <li class="active"><a href="#color-favorite-list-1" role="tab"  style="padding-right:40px;" data-url="/favorites/mine/Color #my-favorite-list" data-toggle="tab"><i class="fa fa-heart-o"></i> 收藏配色</a>
			  		<a href="#color-favorite-list-1" class="showtooltip btn-refresh" style="position:absolute;top:0px;right:0px;cursor: pointer;background: transparent;border:0 none;" data-refresh="always" title="点击刷新收藏配色" data-url="/favorites/mine/Color #my-favorite-list" role="tab" data-toggle="tab"><i class="fa fa-refresh"></i></a>
			  </li>
			  {{/if}}
			  <li><a href="#color-all-list-1" data-url="/colors/lists #color-all-list-1" role="tab" data-toggle="tab"><i class="fa fa-list"></i> 配色方案</a></li>
			
		</ul>
		
		{{/if}}
			<div class="tab-content"  style="padding:0px;overflow-x:hidden;" id="colors-tab-content">
				<div id="color-favorite-list-1" class="tab-pane active">
{{/if}}				
       <div id="my-favorite-list" class="row">

       		{{$page_navi}}		
		    <ul class="clearfix">
		    <?php
		       
		$rows = array();
        foreach ($datalist AS $item_all) {
				$item = $item_all[$model];
			if($model == 'EditorStyle') {
	?>
				<div class="col-md-4 col-sm-6" style="padding:5px;">
					<div style="border:1px solid #ddd;margin-top:10px;padding:10px;">
						<div>{{$item['name']}} &nbsp; <small>{{$item_all['Favorite']['created']}}</small></div>
						<p><img src="{{$item['coverimg']}}"></p>
						<div id="editor-style-content">
							{{$item['content']}}
						</div>
					</div>
				</div>
		<?php
			} elseif($model == 'Color'){
				
		?>
<ul style="margin:0 0;padding:0 0;list-style: none;text-align:center;" class="clearfix">					       
<?php
$colors =  explode("\r\n",$item['colors']);
foreach($colors as $c) {
	$cts = explode(';',$c);
	if(count($cts) == 2) {
		echo '<li class="color-swatch" title="<strong>'.$cts[0].'</strong><br/>'.$cts[1].'" data-html="true" data-container="body" data-toggle="tooltip" style="background-color:'.$cts[0].'"></li>';
	}
	else{
		echo '<li class="color-swatch" title="'.$c.'"  data-container="body" data-toggle="tooltip" style="background-color:'.$c.'"></li>';
	}
}
?>
</ul>			
		<?php
			}  elseif($model == 'Image'){

		?>
				<div class="col-sm-4" style="padding:5px;">
					<div class="appmsg"><div class="cover">
	       		<?php
	       		$appendStyle = 'max-width:100%;';
				if($item['width']) { $appendStyle .= 'width:'.$item['width'].'px;';} 
				if($item['height']) { $appendStyle .= 'height:'.$item['height'].'px !important;';}

	       		if($item['coverimg']) {
					$item['coverimg'] .= '?imageView2/2/w/200'; //加上oss图片处理规则
				}
	       		?>
	       		
	       		{{$this->Html->image($item['coverimg'],array('title'=>$item['name'],'style'=>$appendStyle))}}	       		
	       		</div>
	       		<div style="height: 34px;overflow: hidden;text-align: left;" title="{{$item['name']}}">
	       		{{if $item['source']=='699pic' && $item['third_id']}}
	       			<p style="text-align:right;"><a style="color:#999;" target="_blank" href="http://699pic.com/tupian-{{$item['third_id']}}.html">来自摄图网</a></p>
	       		{{else}}
	       			{{usubstr($item['name'],0,16)}}
	       		{{/if}}
	       		</div></div>
	       		</div>
		<?php
			}
		}      
    ?>
		    </ul>
		    {{$page_navi}}


		 </div>	 
{{if empty($_GET['inajax'])}}	
		 </div>
		 <div id="color-all-list-1" class="tab-pane"></div>
		</div>
    </div>
{{/if}}